# 用户名验证自定义转换器
class UsernamConverter:

    regex = '[a-zA-Z0-9_-]{5,20}'

    def to_python(self,value):
        return value


# 手机号验证自定义转换器

class MobileConverter:
    regex = '1[3-9]\d{9}'

    def to_python(self, value):
        return value

# 图片验证码

class UUIDConverter:
    regex = '[\w-]+'

    def to_python(self, value):
        return str(value)